package Recursion;

/**
 * Created with IntelliJ IDEA.
 * User: Bjarke
 * Date: 06-11-13
 * Time: 22:14
 * To change this template use File | Settings | File Templates.
 */
public class RecursionExample {

    private int num = 0;
    public int recursionTest(int num){

        if (num == 1){
            return 1;
        } else {
            System.out.println("");
            return (num + recursionTest(num - 1));
        }
    }

    public static void main(String args[]){

        RecursionExample recursionExample = new RecursionExample();

        recursionExample.recursionTest(6);

    }
}
